<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>天气案例</title>
    <script src="../commonjs/vue.js"></script>
</head>
<body>
    <div id="root">
        <span>今天天气真{{info}}<br/><br/></span>
        <button @click="changeWeather">切换天气</button>
    </div>
    <script>
        Vue.config.productionTip = false;//关闭开发提示
        new Vue({
            el:'#root',
            data:{
                isHot:true
            },
            computed:{
                info(){
                    return this.isHot ? '炎热' : '寒冷'
                }
            },
            methods:{
                changeWeather(){
                    this.isHot = !this.isHot
                }
            }
        })
    </script>
</body>
</html>